package com.kefu.boss.service;

import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kefu.boss.mapper.BossRoleMapper;
import com.kefu.boss.mapper.BossUserRoleMapper;
import com.kefu.boss.model.BossRole;
import com.kefu.boss.model.BossUser;
import com.kefu.boss.model.BossUserRole;
import com.kefu.boss.vo.BossRoleSearchVo;
import com.kefu.common.service.AbstractKefuService;
import com.kefu.sys.mapper.SysUserRoleMapper;
import com.kefu.sys.model.SysRole;
import com.kefu.sys.model.SysUser;
import com.kefu.sys.model.SysUserRole;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;

@Slf4j
@Service
public class BossRoleService extends AbstractKefuService<BossRole> {
    @Resource
    protected BossRoleMapper bossRoleMapper;
    @Resource
    protected BossUserRoleMapper bossUserRoleMapper;
    public List<BossRole> getByUserId(String userId) {
        return bossRoleMapper.getByUserId(userId);
    }

    // 根据角色名称和描述获取角色列表（分页）
    public Page<BossRole> getRoleList(BossRoleSearchVo search) {
        Page<BossRole> page = searchLambdaPage(search);
        for (BossRole role : page.getRecords()) {
        }
        return page;
    }
}
